<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php $model    = $this->data['model']; ?>
<?php $user     = $this->data['user']; ?>
<?php $motor_id = $this->data['motor_id']; ?>
<?php $motor    = $model->getMotor($motor_id); ?>
<h1>База данных по моторам</h1>
<h2>Новая установка мотора <?= $motor['title'] ?></h2>
<div class="rcbase_content">
	<form action="/?option=com_rcbase&view=motorset&task=saveset" method="post" enctype="multipart/form-data">
		<input type="hidden" name="motor_id" value="<?= $motor_id ?>"/>
		<input type="hidden" name="user_id" value="<?= $user->id ?>"/>
		<table class="table" border="1">
			<tr>
				<th colspan="3">Модель</th>
				<th colspan="3">Винт</th>
				<th rowspan="2">АКБ (кол. банок)</th>
				<th rowspan="2">ESC (А)</th>
			</tr>
			<tr>
				<th>Название</th>
				<th>Тип</th>
				<th>Вес (г)</th>
				<th>Тип</th>
				<th>Диаметр (дюйм)</th>
				<th>Шаг (дюйм)</th>
			</tr>
			<?php for ($i=1;$i<=10;$i++): ?>
			<tr>
				<td align="right"><input type="text" name="model_name[]" value="" size="25" maxlength="255"/></td>
				<td align="right">
					<select name="model_type[]">
						<option value="1">Тренер</option>
						<option value="2">Копия/Полукопия</option>
						<option value="3">Пилотажка</option>
						<option value="4">3D Акробат</option>
					</select>
				</td>
				<td align="right"><input type="text" name="model_weight[]" value="" size="5" maxlength="4"/></td>
				<td align="right"><input type="text" name="prop_type[]" value="" size="15" maxlength="10"/></td>
				<td align="right"><input type="text" name="prop_d[]" value="" size="4" maxlength="2"/></td>
				<td align="right"><input type="text" name="prop_h[]" value="" size="4" maxlength="3"/></td>
				<td align="right"><input type="text" name="cells[]" value="" size="4" maxlength="1"/></td>
				<td align="right"><input type="text" name="esc_current[]" value="" size="4" maxlength="4"/></td>
			</tr>
			<?php endfor; ?>
			<tr>
				<td colspan="8" align="right">
					<input type="submit" name="addset" value="Сохранить"/>
				</td>
			</tr>
		</table>
	</form>
</div>